{include file="common/_header"}

<body>

<div class="x-body layui-anim layui-anim-up">
    <form class="layui-form">
        <input type="hidden" name="send_id" value="{$data.send.send_id}">
        <input type="hidden" name="handle" value="ajax">

        <div>

            <div class="wine_div1">
                <div class="wine_div2">服务地址：</div>
                <div class="wine_div3">

                     <textarea class="layui-textarea" rows="5" cols="10">{$data.send.province_name} {$data.send.city_name} {$data.send.area_name} {$data.send.street_name} {$data.send.detail}</textarea>
                </div>
            </div>



            <div class="wine_div1">
                <div class="wine_div2">状态：</div>
                <div class="wine_div3">
                    <select name="team">
                        {empty name="data.teamlist"}
                        <option value="">此区域没有街道团队可供派单</option>
                        {/empty}
                        {volist name="data.teamlist" id="vo"}
                        <option value="{$vo.team_id}">{$vo.team_name}</option>
                        {/volist}
                    </select>
                </div>
            </div>



        </div>


        <div style="margin-top: 50px; float: right; margin-right: 50px;">
            <button type="button" lay-submit lay-filter="add" class="layui-btn">立即提交</button>
        </div>
    </form>
</div>
</body>


<script>
    layui.use(['form', 'layer', 'layedit', 'upload'], function () {

        var form = layui.form;

        form.on('submit(add)', function (data) {
            console.log(data.field);
            $.ajax({
                'url': '/service/sendsing',
                'type': 'post',
                'data': data.field,
                'dataType': 'json',
                success: function (data) {
                    if (data.code == 1) {
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 800,
                        }, function () {
                            window.parent.location.href = data.url;
                        })
                    } else if (data.code == 0) {
                        layer.msg(data.msg);
                    }
                }
            });
        });

    });


</script>

{include file="common/_bottom"}